package ace.module.account.core.impl.service.authentication.model.bo;

import ace.module.account.api.model.auth.AuthenticationGrantType;
import ace.module.account.api.model.auth.input.AuthenticationParams;
import ace.module.account.core.impl.dao.entity.IamApplication;
import jakarta.annotation.Nullable;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author caspar
 * @date 2023/3/29 11:41
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AuthenticationContextBo<T extends AuthenticationParams> {

  /**
   * oauth2 id of client
   */
  @NotEmpty
  private String idOfClient;

  /**
   *
   */
  @NotNull
  private IamApplication iamApplication;

  /**
   * authorization grant type {@link AuthenticationGrantType#getCode()}
   */
  @NotEmpty
  private String authenticationGrantType;

  /**
   * 账户标签
   */
  @Nullable
  private String tag;

  /**
   * 业务参数
   */
  @Valid
  private T bizParams;
}
